<template>
  <div class="box">
    <div class="nav">
      <div class="nav-l">
        <img
          :src="require('../../public/vidoe/spym-1.png')"
          alt=""
          @click="back"
          class="back"
        />
        <div class="msg">
          <div class="msg1">
            <img
              :src="require('../../public/faxian/亲子头像.png')"
              alt=""
              class="head"
            />
          </div>
          <div class="msg-r">
            <div class="msg-t">
              <span>亲子育儿</span>
              <img :src="require('../../public/vidoe/spym-2.png')" alt="" />
            </div>
            <p>06-11 00.00</p>
          </div>
        </div>
      </div>
      <div class="nav-r">
        <p>+ 关注</p>
        <img :src="require('../../public/vidoe/spym-3.png')" alt="" />
      </div>
    </div>
    <div class="main">
      <div class="title">你能接受你的孩子平庸吗？</div>
      <div class="video">
        <iframe
          frameborder="0"
          scrolling="no"
          src="https://haokan.baidu.com/v?pd=wisenatural&vid=14016189103731507711&tiny=0&auto=0"
          allowfullscreen
        ></iframe>
      </div>
      <div class="text">
        樊登老师建议，家长应该把时间和精力更多用来要求自己，而不是要求孩子非要去成为一个杰出的人。
      </div>
    </div>
    <div class="footer">
      <div class="pinglun pic">
        <img
          :src="require('../../public/vidoe/spym-6.png')"
          alt=""
          @click="tocom"
        /><span>2</span>
      </div>
      <div class="shoucang pic">
        <img :src="imgUrl" alt="" @click="change" /><span>{{ num }}</span>
      </div>
      <div class="dianzan pic">
        <img :src="imgUrl1" alt="" @click="change1" /><span>{{ num1 }}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { useRouter } from "vue-router";
import { ref } from "vue";
export default {
  setup() {
    const router = useRouter();
    const imgUrl = ref(require("../../public/vidoe/spym-7.png"));
    const imgUrl1 = ref(require("../../public/vidoe/spym-8.png"));
    const boolean = ref(true);
    const num = ref(99);
    const num1 = ref(258);
    const change = () => {
      boolean.value = !boolean.value;
      if (boolean.value === false) {
        imgUrl.value = require("../../public/vidoe/spym-14.png");
        num.value++;
      } else {
        imgUrl.value = require("../../public/vidoe/spym-7.png");
        num.value--;
      }
    };
    const change1 = () => {
      boolean.value = !boolean.value;
      if (boolean.value === false) {
        imgUrl1.value = require("../../public/vidoe/spym-15.png");
        num1.value++;
      } else {
        imgUrl1.value = require("../../public/vidoe/spym-8.png");
        num1.value--;
      }
    };
    const back = () => {
      router.go(-1);
    };
    const tocom = () => {
      router.push("/comment");
    };
    return {
      back,
      router,
      tocom,
      imgUrl,
      boolean,
      change,
      num,
      num1,
      change1,
      imgUrl1,
    };
  },
};
</script>

<style lang="less" scoped>
.box {
  .nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    padding-left: 16px;
    padding-right: 13px;
    .nav-l {
      display: flex;
      align-items: center;
      .back {
        display: inline-block;
        width: 13px;
        height: 22px;
      }
      .msg {
        display: flex;
        border-radius: 50%;
        align-items: center;
        .msg1 {
          width: 31px;
          height: 31px;
          border-radius: 50%;
          margin-left: 16px;
          margin-right: 9px;
          border: none;
          .head {
            width: 31px;
            height: 31px;
          }
        }
        .msg-r {
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          span {
            font-size: 12.5px;
            margin-right: 5px;
          }
          img {
            display: inline-block;
            height: 12px;
            width: 12px;
          }
        }
      }
    }
    .nav-r {
      display: flex;
      p {
        width: 56px;
        height: 24px;
        border-radius: 12px;
        background: #f4d547;
        font-size: 12px;
        line-height: 24px;
        text-align: center;
        vertical-align: middle;
        margin-right: 10px;
      }
      img {
        display: inline-block;
        vertical-align: middle;
        width: 20px;
        height: 20px;
        margin-top: 2px;
      }
    }
  }
  .main {
    .title {
      padding: 19px 20px;
      font-size: 19px;
      font-weight: 600;
      line-height: 20px;
    }
    .video {
      iframe {
        width: 100%;
        height: 210px;
        overflow-y: hidden;
      }
    }
    .text {
      padding: 35px 17px;
      font-size: 18px;
      line-height: 26px;
      font-weight: 500;
    }
  }
  .footer {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 50px;
    width: 100%;
    display: flex;
    .pic {
      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      span {
        font-size: 9px;
        margin-top: 10px;
      }
    }
  }
}
</style>
